<template>
  <a-modal :maskClosable="false" :destroyOnClose="true" centered :footer="null" :width="400" v-model="visible">
    <div>
      <div class="line1 mb20">
        <img class="logo" :src="record.logo" alt="" />
        <span class="name">{{ record.orgName }}</span>
      </div>
      <template v-for="(item, index) in list">
        <div :key="index">
          <div class="line2">{{ item.projectStr }}</div>
          <Item
            :priceContact="item.priceContact"
            :priceContactCompute="1"
            :discount="1"
            :pricePeople="1"
            :pricePeopleCompute="1"
          />
        </div>
      </template>
    </div>
  </a-modal>
</template>

<script>
import { OrgResource } from '@/api/business/cooperation'
import Item from '../../components/item.vue'
export default {
  components: {
    Item,
  },
  data() {
    return {
      visible: false,
      list: [],
      record: {},
    }
  },
  methods: {
    show(record) {
      this.record = record
      let { tenantId, orgType } = record
      this.getOrgResource(tenantId, orgType)
      this.visible = true
    },
    async getOrgResource(tenantId, projectType) {
      let res = await OrgResource({ tenantId, projectType })
      console.log('res--->', res)
      this.list = res.data
    },
  },
}
</script>

<style lang="less" scoped>
.line1 {
  display: flex;
  align-items: center;
  justify-content: center;
  .logo {
    height: 40px;
    width: 40px;
    border-radius: 50%;
  }
  .name {
    font-size: 16px;
    font-weight: bold;
    margin-left: 10px;
  }
}
.line2 {
  font-size: 16px;
  font-weight: bold;
  border-bottom: 1px #ccc solid;
  padding: 10px 0;
}
.warp {
  padding-left: 20px;
  .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    .left {
      .title {
        font-size: 14px;
        font-weight: bold;
      }
      .num {
      }
    }
    .right {
      color: red;
      .price {
        font-size: 14px;
        font-weight: bold;
      }
    }
  }
}
</style>